summaryrefslogtreecommitdiff
path: root/src/basic/login-util.c
blob: d69b413e6e0b933bcd048a950fda78ee927524b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
  This file is part of systemd.

  Copyright 2013 Zbigniew Jędrzejewski-Szmek
***/

#include <string.h>

#include "login-util.h"
#include "string-util.h"

bool session_id_valid(const char *id) {

        if (isempty(id))
                return false;

        return id[strspn(id, LETTERS DIGITS)] == '\0';
}