garabik / python-utmp Goto Github PK
View Code? Open in Web Editor NEWpython module for working with utmp records (read/write)
Home Page: http://kassiopeia.juls.savba.sk/~garabik/software/python-utmp.html
License: Other
python module for working with utmp records (read/write)
Home Page: http://kassiopeia.juls.savba.sk/~garabik/software/python-utmp.html
License: Other
When I build python-utmp package in Fedora, there is reported a following warning:
$ rpmbuild -ba SPECS/python-utmp.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.zmkJXv
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ cd /home/makerpm/rpmbuild/BUILD
+ rm -rf python-utmp
+ /usr/bin/gzip -dc /home/makerpm/rpmbuild/SOURCES/python-utmp_0.8.2.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd python-utmp
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.6WXr7b
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ cd python-utmp
+ make -f Makefile.glibc 'DEFINES= -D_HAVE_UT_SESSION -D_HAVE_UT_ADDR_V6 -D_HAVE_UT_EXIT -D_HAVE_UT_HOST -D_HAVE_UT_ID -D_HAVE_UT_TV -D_HAVE_UT_USER -D_HAVE_UTMPNAME -D_HAVE_SETUTENT -D_HAVE_GETUTENT -D_HAVE_ENDUTENT -D_HAVE_GETUTID -D_HAVE_GETUTLINE -D_HAVE_PUTUTLINE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' PYTHONVER=2.7
gcc -g -Wall -I/usr/include/python2.7/ -D_HAVE_UT_SESSION -D_HAVE_UT_ADDR_V6 -D_HAVE_UT_EXIT -D_HAVE_UT_HOST -D_HAVE_UT_ID -D_HAVE_UT_TV -D_HAVE_UT_USER -D_HAVE_UTMPNAME -D_HAVE_SETUTENT -D_HAVE_GETUTENT -D_HAVE_ENDUTENT -D_HAVE_GETUTID -D_HAVE_GETUTLINE -D_HAVE_PUTUTLINE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fpic -c utmpaccessmodule.c
gcc -g -Wall -I/usr/include/python2.7/ -D_HAVE_UT_SESSION -D_HAVE_UT_ADDR_V6 -D_HAVE_UT_EXIT -D_HAVE_UT_HOST -D_HAVE_UT_ID -D_HAVE_UT_TV -D_HAVE_UT_USER -D_HAVE_UTMPNAME -D_HAVE_SETUTENT -D_HAVE_GETUTENT -D_HAVE_ENDUTENT -D_HAVE_GETUTID -D_HAVE_GETUTLINE -D_HAVE_PUTUTLINE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fpic -shared utmpaccessmodule.o -o utmpaccessmodule.so
./makeconst.sh -g -Wall -I/usr/include/python2.7/ -D_HAVE_UT_SESSION -D_HAVE_UT_ADDR_V6 -D_HAVE_UT_EXIT -D_HAVE_UT_HOST -D_HAVE_UT_ID -D_HAVE_UT_TV -D_HAVE_UT_USER -D_HAVE_UTMPNAME -D_HAVE_SETUTENT -D_HAVE_GETUTENT -D_HAVE_ENDUTENT -D_HAVE_GETUTID -D_HAVE_GETUTLINE -D_HAVE_PUTUTLINE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic
makeconst.c: In function 'main':
makeconst.c:28:18: warning: format '%i' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
PRL(UT_IDSIZE);
^
makeconst.c:6:24: note: in definition of macro 'PRL'
#define PRL(s) printf(#s" = %i\n", s);
^
I have tried adding the following entry:
from utmp import UtmpRecord
r = UtmpRecord()
r.pututline(dict(ut_type=utmp.USER_PROCESS, ut_pid=1111, ut_line="", ut_id=":10", ut_user="stdedos", ut_host="desktop", ut_exit=(0, 0), ut_session=8888, ut_tv=(1583137777, 333333), ut_addr_v6=(0, 0, 0, 0)))
r.endutent()
but it's not coming on w
command. There seems to be no error or raise.
Additionally, there are no examples using pututline
. Could you help / explain what am I doing wrong?
On Ubuntu Bionic, using python3.7 (3.6, 3.8 also installed, but only 3.6 is getting detected for the purposes of apt-get
installation)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.